1
2
3
4
5
6
7
8
9 package ca.uhn.cache;
10
11
12
13 /***
14 * Adapts the arguments and return values of a particular Java method
15 * to work with a <code>IDataSource</code>. It is assumed that the Java
16 * method corresponds to some query, and the return value corresponds
17 * to the results of the query, which are to be cached.
18 *
19 * Meant to be implemented for each method to be wrapped.
20 *
21 * Used by <code>MethodDataSource</code>.
22 *
23 * @author <a href="mailto:alexei.guevara@uhn.on.ca">Alexei Guevara</a>
24 * @version $Revision: 1.1 $ updated on $Date: 2005/01/24 22:52:08 $ by $Author: bryan_tripp $
25 */
26 public interface IMethodDataSourceHelper {
27
28 /***
29 * Builds a query result from the provided object.
30 *
31 * A <code>IQueryResult</code> is composed of zero or more <code>IDataItem</code>s.
32 *
33 * @param theObject The provided object.
34 * @return The query result.
35 */
36 public IQueryResult buildQueryResult( Object theObject );
37
38 /***
39 * Builds the arguments to be used in the underlying method invocation, corresponding to the provided query.
40 * @param theQuery The provided query.
41 * @return The arguments built.
42 */
43 public Object[] buildArguments( IQuery theQuery );
44
45 }